package com.cloud.service.base;

import java.util.List;

/**
 * 最基本的增删改查
 * @param <T>
 */
public interface BaseService<T> {
    /**
     * 保存 entity.
     *
     * @param entity the entity
     * @return entity
     */
    public T saveEntity(T entity);

    /**
     * 删除 entity.
     *
     * @param id the id
     */
    public void deleteEntity(long id);

    /**
     * 批量删除
     */
    public void deleteEntities(String ids);



    /**
     * 更新 entity.
     *
     * @param entity the entity
     */
    public void updateEntity(T entity);

    /**
     * 获取 entity.
     *
     * @param id the id
     * @return entity the entity
     */
    public T getEntity(long id);

    /**
     * 统计
     */
    public long getEntitiesCount();

    /**
     * 查询全部
     */
    public List<T> findAll();


}
